home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / code / contr / setup.exe / Disk1 / data1.cab / Configuration_En / Toolbars / siteSettings_TEMP.js < prev   
Encoding:
JavaScript  |  2003-07-18  |  2.9 KB  |  107 lines

  1. // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2. // Specifies tag to use when applying font changes.
  3. // Return either "font" or "span".
  4. function getFontTag(){
  5.     var dom = dw.getDocumentDOM();
  6.  
  7.     return dom.getCCSharedSetting_FontsEmitFontOrSpan();
  8. }
  9.  
  10. // Specifes units when font changes are applied with SPAN tags 
  11. // (ignored if getFontTag() returns "font"). Return either
  12. // "pixels" or "points".
  13. function getFontUnits(){
  14.     var dom = dw.getDocumentDOM();
  15.  
  16.     return dom.getCCSharedSetting_FontsEmitFontUnits();
  17. }
  18.  
  19. // Defines list of default fonts. Enclose multiple-word font names in single quotes.
  20. function getFontList()
  21. {
  22.     return dw.getFontList();
  23. }
  24.  
  25. // Specifies whether to show the Font and Size menus
  26. // in the toolbar. Return either true or false (no quotation marks).
  27. function getShowFontsAndSizes(){
  28.     var dom = dw.getDocumentDOM();
  29.  
  30.     return dom.getCCSharedSetting_FontsLetUserChange();
  31. }
  32.  
  33.  
  34. // NOTE: If both of the following functions return false, then
  35. // the Style pop-up menu will not appear in the toolbar. In addition,
  36. // if getShowHeadings() is false and there are no styles defined for
  37. // the document, the pop-up menu will also not appear. It will reappear
  38. // if a document containing styles is opened.
  39.  
  40. // Specifies whether to show H1, H2, P, etc. in Styles list. 
  41. // Return either true or false (no quotation marks).
  42. function getShowHeadings(){
  43.     var dom = dw.getDocumentDOM();
  44.  
  45.     return dom.getCCSharedSetting_StyleHTMLHeadings();
  46. }
  47.  
  48. // Specifies whether to show CSS Styles in Styles list. 
  49. // Return either true or false (no quotation marks).
  50. function getShowStyles(){
  51.     var dom = dw.getDocumentDOM();
  52.  
  53.     return dom.getCCSharedSetting_StyleCSS();
  54. }
  55.  
  56. // True/False: does the selected tag make sense to FONT or B (bold) or I (italisize), etc.
  57. function isSelectionTextuallyModifiable(dom){
  58.     var ret = true;
  59.  
  60.     // Hack to get around the fact that dw.getSelectedNode() thinks
  61.     // an <img> is selected if the caret is an IP before it.  We
  62.     // just assume all IPs are okay for the purposes of this function.
  63.     var selection = dom.getSelection();
  64.     if (selection && selection[0] != selection[1])
  65.     {
  66.         var node = dom.offsetsToNode(selection[0], selection[1]);
  67.         if (node && node.tagName)
  68.         {
  69.             var tag = node.tagName;
  70.             //  Hmmmm.  Should the following be in this list, too?
  71.             //        DIV
  72.             //        P
  73.             //        H1 - H6
  74.             //        BLOCKQUOTE
  75.             //        UL
  76.             //        OL
  77.             //        LI
  78.             //        DT
  79.             //        DD
  80.             //        TABLE
  81.             //        FORM
  82.             //      (various server-side tags)
  83.             if (
  84.                 (tag == 'HTML')        ||
  85.                 (tag == 'HEAD')        ||
  86.                 (tag == 'TITLE')        ||
  87.                 (tag == 'HR')            ||
  88.                 (tag == 'IMG')        ||
  89.                 (tag == 'MAP')        ||
  90.                 (tag == 'AREA')        ||
  91.                 (tag == 'FRAMESET')    ||
  92.                 (tag == 'FRAME')        ||
  93.                 (tag == 'BASE')        ||
  94.                 (tag == 'NOFRAMES')    ||
  95.                 (tag == 'META')        ||
  96.                 (tag == 'STYLE')        ||
  97.                 (tag == 'LINK')
  98.                )
  99.             {
  100.                 ret = false;
  101.             }
  102.         }
  103.     }
  104.  
  105.     return ret;
  106. }
  107.